package network;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
 * Message Queue is a FIFO blocking queue which is used to store the message.
 * @author Jie Zhao(288654)
 *
 */
public class MessageQueue {
	BlockingQueue<Message> mq = new LinkedBlockingQueue<Message>();
	
	
	public Message takeMessage() throws InterruptedException
	{
		return mq.take();
	}
	
	public void putMessage(Message m) throws InterruptedException
	{
		if(m == null)return;
		mq.put(m);
	}
}
